Skip to content

stm32: do not declare ADC interrupts unless using SIMPLEFOC_STM32_ADC_INTERRUPT - #546

Open
Moddingear wants to merge 2 commits into
simplefoc:devfrom
Moddingear:stm32_free_adc_isr
Open

Moddingear wants to merge 2 commits into
simplefoc:devfrom
Moddingear:stm32_free_adc_isr

Conversation

@Moddingear

Copy link
Copy Markdown
Contributor

This allows the user to declare their own ADC interrupts when they're not in use by SimpleFOC (which they're not by default)

@dekutree64

dekutree64 commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Looks good. I usually use DMA for the ADC results, but have used interrupts as well, and had to hunt down that function in the library code and disable it. Better to control it with a #define so you don't have to modify the library code.

@askuric

askuric commented Oct 4, 2026

Copy link
Copy Markdown
Member

Hey @Moddingear ,

This will not work in oour case.
We do use interrupts in the library actually.

When the timer does not have interrupt counter we use interrupt callback to downsample the readings.
If the timer does have the repetition counter we do not use interrupts.

The proposed PR woudl break the readings on timers without repetition counter.

So we might add a new flag somewhere called
SIMPLEFOC_STM32_ADC_DISABLE_RC_FALLBACK

And condition the ADC handlers on this maybe. If this flag is not defined then the interrupts are not allowed and you can condition the adc handler definitions on this.

@Moddingear

Copy link
Copy Markdown
Contributor Author

Modified as requested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants